package com.wjx.demo.collection

fun main(args: Array<String>) {
    val s1 = setOf<Int>(1, 3, 2)  //只读
    println(s1)
    val s2 = mutableSetOf<Int>(1, 6, 3, 7, 2, 2) //可写
    println(s2)

    val s3 = hashSetOf<Int>(1, 4, 3)
    val s4 = sortedSetOf(2, 4, 3)//=treeSet
    println(s3)
    println(s4)
    val s5 = s3.sortedDescending()
    println(s5)
    val s6 = sortedSetOf(Comparator { o1, o2 -> o1 - o2 }, 2, 4, 3)
    println(s6)
}